{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "# import\n",
    "import numpy as np\n",
    "import pandas as pd\n",
    "from scipy.sparse import find\n",
    "from scipy.special import comb\n",
    "# from restrictiveness import *\n",
    "from restrictiveness_fast import *\n",
    "from pathlib import Path\n",
    "\n",
    "## mat file\n",
    "from scipy.io import loadmat"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "# load mat file\n",
    "file_name = '../data/Bruhin_et_al_2010.mat'\n",
    "matdata = loadmat(file_name)\n",
    "df_full = pd.DataFrame()\n",
    "for key in matdata.keys():\n",
    "    if not '__' in key:\n",
    "        df_full[key] = matdata[key].flatten()\n",
    "\n",
    "# drop lotteries over losses\n",
    "df = df_full[df_full['z2'] >= 0]\n",
    "\n",
    "# preprocessing\n",
    "df_lottery = preprocess_df(df)\n",
    "fosd = generate_FOSD_matrix(df_lottery)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Generate a fake CE dataset"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "filepath = Path('generated_ce.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "seed = 5\n",
    "max_iter = 10000\n",
    "sample_size = 1000\n",
    "\n",
    "np.random.seed(seed)\n",
    "row_restriction, col_restriction, _ = find(fosd)\n",
    "count = 0\n",
    "df_ce = pd.DataFrame()\n",
    "\n",
    "for iter in range(max_iter):\n",
    "    ce = generate_fake_ce(df_lottery)\n",
    "    fosd_checked = pass_FOSD_criterion(ce, row_restriction, col_restriction)\n",
    "    if fosd_checked:\n",
    "        df_ce['ce_iter{}'.format(count)] = ce\n",
    "        count += 1\n",
    "        if count >= sample_size:\n",
    "            break\n",
    "\n",
    "if count < sample_size:\n",
    "    print('count: {}'.format(count))\n",
    "    print('sample size is not large enough')\n",
    "else:\n",
    "    print('success')\n",
    "\n",
    "# df_ce.to_csv(filepath, index=False)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>ce_iter0</th>\n",
       "      <th>ce_iter1</th>\n",
       "      <th>ce_iter2</th>\n",
       "      <th>ce_iter3</th>\n",
       "      <th>ce_iter4</th>\n",
       "      <th>ce_iter5</th>\n",
       "      <th>ce_iter6</th>\n",
       "      <th>ce_iter7</th>\n",
       "      <th>ce_iter8</th>\n",
       "      <th>ce_iter9</th>\n",
       "      <th>...</th>\n",
       "      <th>ce_iter990</th>\n",
       "      <th>ce_iter991</th>\n",
       "      <th>ce_iter992</th>\n",
       "      <th>ce_iter993</th>\n",
       "      <th>ce_iter994</th>\n",
       "      <th>ce_iter995</th>\n",
       "      <th>ce_iter996</th>\n",
       "      <th>ce_iter997</th>\n",
       "      <th>ce_iter998</th>\n",
       "      <th>ce_iter999</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1.074895</td>\n",
       "      <td>3.186464</td>\n",
       "      <td>1.368790</td>\n",
       "      <td>2.597316</td>\n",
       "      <td>0.711680</td>\n",
       "      <td>0.780305</td>\n",
       "      <td>0.792384</td>\n",
       "      <td>0.467590</td>\n",
       "      <td>1.438647</td>\n",
       "      <td>3.712405</td>\n",
       "      <td>...</td>\n",
       "      <td>0.778489</td>\n",
       "      <td>1.490550</td>\n",
       "      <td>2.401454</td>\n",
       "      <td>2.120204</td>\n",
       "      <td>0.477940</td>\n",
       "      <td>2.452378</td>\n",
       "      <td>3.874772</td>\n",
       "      <td>1.246466</td>\n",
       "      <td>2.696701</td>\n",
       "      <td>1.309049</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>5.809185</td>\n",
       "      <td>3.653330</td>\n",
       "      <td>7.193999</td>\n",
       "      <td>4.436662</td>\n",
       "      <td>2.306826</td>\n",
       "      <td>4.786842</td>\n",
       "      <td>3.240430</td>\n",
       "      <td>6.854843</td>\n",
       "      <td>5.057409</td>\n",
       "      <td>6.388424</td>\n",
       "      <td>...</td>\n",
       "      <td>1.786370</td>\n",
       "      <td>3.665992</td>\n",
       "      <td>2.893943</td>\n",
       "      <td>2.366065</td>\n",
       "      <td>2.868784</td>\n",
       "      <td>5.496927</td>\n",
       "      <td>5.888913</td>\n",
       "      <td>7.170768</td>\n",
       "      <td>5.794429</td>\n",
       "      <td>2.890640</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>9.865014</td>\n",
       "      <td>4.779413</td>\n",
       "      <td>9.667267</td>\n",
       "      <td>9.441884</td>\n",
       "      <td>4.205863</td>\n",
       "      <td>8.335880</td>\n",
       "      <td>4.804511</td>\n",
       "      <td>9.866969</td>\n",
       "      <td>7.759213</td>\n",
       "      <td>6.996166</td>\n",
       "      <td>...</td>\n",
       "      <td>3.664306</td>\n",
       "      <td>5.528432</td>\n",
       "      <td>6.687533</td>\n",
       "      <td>4.512935</td>\n",
       "      <td>5.908771</td>\n",
       "      <td>9.333988</td>\n",
       "      <td>6.452701</td>\n",
       "      <td>8.231505</td>\n",
       "      <td>9.308701</td>\n",
       "      <td>7.508190</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0.622601</td>\n",
       "      <td>2.687275</td>\n",
       "      <td>8.825206</td>\n",
       "      <td>0.849730</td>\n",
       "      <td>2.844768</td>\n",
       "      <td>0.229133</td>\n",
       "      <td>1.094750</td>\n",
       "      <td>3.529608</td>\n",
       "      <td>2.598226</td>\n",
       "      <td>7.498957</td>\n",
       "      <td>...</td>\n",
       "      <td>12.041412</td>\n",
       "      <td>3.332867</td>\n",
       "      <td>2.518114</td>\n",
       "      <td>0.882730</td>\n",
       "      <td>1.931493</td>\n",
       "      <td>1.733572</td>\n",
       "      <td>0.694095</td>\n",
       "      <td>0.087652</td>\n",
       "      <td>3.593771</td>\n",
       "      <td>1.109147</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>4.837181</td>\n",
       "      <td>5.304605</td>\n",
       "      <td>14.429775</td>\n",
       "      <td>5.760958</td>\n",
       "      <td>14.617881</td>\n",
       "      <td>10.790497</td>\n",
       "      <td>2.199606</td>\n",
       "      <td>10.376876</td>\n",
       "      <td>7.993169</td>\n",
       "      <td>8.456891</td>\n",
       "      <td>...</td>\n",
       "      <td>14.197557</td>\n",
       "      <td>10.030600</td>\n",
       "      <td>3.953321</td>\n",
       "      <td>8.703802</td>\n",
       "      <td>4.744183</td>\n",
       "      <td>5.413577</td>\n",
       "      <td>10.223253</td>\n",
       "      <td>6.005143</td>\n",
       "      <td>9.711591</td>\n",
       "      <td>5.579480</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 1000 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   ce_iter0  ce_iter1   ce_iter2  ce_iter3   ce_iter4   ce_iter5  ce_iter6  \\\n",
       "0  1.074895  3.186464   1.368790  2.597316   0.711680   0.780305  0.792384   \n",
       "1  5.809185  3.653330   7.193999  4.436662   2.306826   4.786842  3.240430   \n",
       "2  9.865014  4.779413   9.667267  9.441884   4.205863   8.335880  4.804511   \n",
       "3  0.622601  2.687275   8.825206  0.849730   2.844768   0.229133  1.094750   \n",
       "4  4.837181  5.304605  14.429775  5.760958  14.617881  10.790497  2.199606   \n",
       "\n",
       "    ce_iter7  ce_iter8  ce_iter9  ...  ce_iter990  ce_iter991  ce_iter992  \\\n",
       "0   0.467590  1.438647  3.712405  ...    0.778489    1.490550    2.401454   \n",
       "1   6.854843  5.057409  6.388424  ...    1.786370    3.665992    2.893943   \n",
       "2   9.866969  7.759213  6.996166  ...    3.664306    5.528432    6.687533   \n",
       "3   3.529608  2.598226  7.498957  ...   12.041412    3.332867    2.518114   \n",
       "4  10.376876  7.993169  8.456891  ...   14.197557   10.030600    3.953321   \n",
       "\n",
       "   ce_iter993  ce_iter994  ce_iter995  ce_iter996  ce_iter997  ce_iter998  \\\n",
       "0    2.120204    0.477940    2.452378    3.874772    1.246466    2.696701   \n",
       "1    2.366065    2.868784    5.496927    5.888913    7.170768    5.794429   \n",
       "2    4.512935    5.908771    9.333988    6.452701    8.231505    9.308701   \n",
       "3    0.882730    1.931493    1.733572    0.694095    0.087652    3.593771   \n",
       "4    8.703802    4.744183    5.413577   10.223253    6.005143    9.711591   \n",
       "\n",
       "   ce_iter999  \n",
       "0    1.309049  \n",
       "1    2.890640  \n",
       "2    7.508190  \n",
       "3    1.109147  \n",
       "4    5.579480  \n",
       "\n",
       "[5 rows x 1000 columns]"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_ce = pd.read_csv('generated_ce.csv')\n",
    "df_ce.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Prepare the inputs"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "z1 = df_lottery['z1'].values\n",
    "z2 = df_lottery['z2'].values\n",
    "p1 = df_lottery['p1'].values\n",
    "expval = df_lottery['expected_value'].values\n",
    "ce_data = df_ce.values"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## CPT"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "# coarse grid size for test\n",
    "alpha_grid_size = 0.2\n",
    "gamma_grid_size = 0.2\n",
    "delta_grid_size = 1.0\n",
    "alpha_lbd = 0.01\n",
    "gamma_lbd = 0.01\n",
    "delta_lbd = 0.1\n",
    "alpha_ubd = 1\n",
    "gamma_ubd = 1\n",
    "delta_ubd = 30\n",
    "alpha_grid = np.arange(alpha_lbd, alpha_ubd+alpha_grid_size, alpha_grid_size)\n",
    "gamma_grid = np.arange(gamma_lbd, gamma_ubd+gamma_grid_size, gamma_grid_size)\n",
    "delta_grid = np.arange(delta_lbd, delta_ubd+gamma_grid_size, delta_grid_size)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "restrictiveness: 0.263965466999765\n",
      "stderr: 0.003091691063038879\n"
     ]
    }
   ],
   "source": [
    "# coarse grid size for test\n",
    "restrictiveness, stderr = compute_restrictiveness(z1, z2, p1, expval, ce_data, param_grid)\n",
    "print('restrictiveness: {}'.format(restrictiveness))\n",
    "print('stderr: {}'.format(stderr))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "# alpha, delta, gamma\n",
    "alpha_grid_size = 0.01\n",
    "gamma_grid_size = 0.01\n",
    "delta_grid_size = 0.1\n",
    "alpha_grid = np.arange(alpha_lbd, alpha_ubd+alpha_grid_size, alpha_grid_size)\n",
    "gamma_grid = np.arange(gamma_lbd, gamma_ubd+gamma_grid_size, gamma_grid_size)\n",
    "delta_grid = np.arange(delta_lbd, delta_ubd+delta_grid_size, delta_grid_size)\n",
    "param_grid = cartesian_product(alpha_grid, gamma_grid, delta_grid)\n",
    "\n",
    "restrictiveness, stderr = compute_restrictiveness(z1, z2, p1, expval, ce_data, param_grid)\n",
    "print('restrictiveness: {}'.format(restrictiveness))\n",
    "print('stderr: {}'.format(stderr))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "restrictiveness: 0.4911627398347643\n",
      "stderr: 0.005727670264886382\n"
     ]
    }
   ],
   "source": [
    "# alpha, gamma\n",
    "alpha_grid = np.arange(alpha_lbd, alpha_ubd+alpha_grid_size, alpha_grid_size)\n",
    "gamma_grid = np.arange(gamma_lbd, gamma_ubd+gamma_grid_size, gamma_grid_size)\n",
    "delta_grid = np.array([1.0])\n",
    "param_grid = cartesian_product(alpha_grid, gamma_grid, delta_grid)\n",
    "\n",
    "restrictiveness, stderr = compute_restrictiveness(z1, z2, p1, expval, ce_data, param_grid)\n",
    "print('restrictiveness: {}'.format(restrictiveness))\n",
    "print('stderr: {}'.format(stderr))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "restrictiveness: 0.5165575751047076\n",
      "stderr: 0.0070913042717956724\n"
     ]
    }
   ],
   "source": [
    "# alpha, delta\n",
    "alpha_grid = np.arange(alpha_lbd, alpha_ubd+alpha_grid_size, alpha_grid_size)\n",
    "gamma_grid = np.array([1.0])\n",
    "delta_grid = np.arange(delta_lbd, delta_ubd+delta_grid_size, delta_grid_size)\n",
    "param_grid = cartesian_product(alpha_grid, gamma_grid, delta_grid)\n",
    "\n",
    "restrictiveness, stderr = compute_restrictiveness(z1, z2, p1, expval, ce_data, param_grid)\n",
    "print('restrictiveness: {}'.format(restrictiveness))\n",
    "print('stderr: {}'.format(stderr))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "restrictiveness: 0.3742405150713741\n",
      "stderr: 0.005038120206496686\n"
     ]
    }
   ],
   "source": [
    "# delta, gamma\n",
    "alpha_grid = np.array([1.0])\n",
    "gamma_grid = np.arange(gamma_lbd, gamma_ubd+gamma_grid_size, gamma_grid_size)\n",
    "delta_grid = np.arange(delta_lbd, delta_ubd+delta_grid_size, delta_grid_size)\n",
    "param_grid = cartesian_product(alpha_grid, gamma_grid, delta_grid)\n",
    "\n",
    "restrictiveness, stderr = compute_restrictiveness(z1, z2, p1, expval, ce_data, param_grid)\n",
    "print('restrictiveness: {}'.format(restrictiveness))\n",
    "print('stderr: {}'.format(stderr))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "restrictiveness: 0.9381479597263337\n",
      "stderr: 0.004045542496342411\n"
     ]
    }
   ],
   "source": [
    "# alpha\n",
    "alpha_grid = np.arange(alpha_lbd, alpha_ubd+alpha_grid_size, alpha_grid_size)\n",
    "gamma_grid = np.array([1.0])\n",
    "delta_grid = np.array([1.0])\n",
    "param_grid = cartesian_product(alpha_grid, gamma_grid, delta_grid)\n",
    "\n",
    "restrictiveness, stderr = compute_restrictiveness(z1, z2, p1, expval, ce_data, param_grid)\n",
    "print('restrictiveness: {}'.format(restrictiveness))\n",
    "print('stderr: {}'.format(stderr))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "restrictiveness: 0.7158906948363919\n",
      "stderr: 0.010495252344795387\n"
     ]
    }
   ],
   "source": [
    "# delta\n",
    "# fine grid\n",
    "alpha_grid = np.array([1.0])\n",
    "gamma_grid = np.array([1.0])\n",
    "delta_grid = np.arange(delta_lbd, delta_ubd+delta_grid_size, delta_grid_size)\n",
    "param_grid = cartesian_product(alpha_grid, gamma_grid, delta_grid)\n",
    "\n",
    "restrictiveness, stderr = compute_restrictiveness(z1, z2, p1, expval, ce_data, param_grid)\n",
    "print('restrictiveness: {}'.format(restrictiveness))\n",
    "print('stderr: {}'.format(stderr))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "restrictiveness: 0.5437830381374292\n",
      "stderr: 0.005595984970150978\n"
     ]
    }
   ],
   "source": [
    "# gamma\n",
    "alpha_grid = np.array([1.0])\n",
    "gamma_grid = np.arange(gamma_lbd, gamma_ubd+gamma_grid_size, gamma_grid_size)\n",
    "delta_grid = np.array([1.0])\n",
    "param_grid = cartesian_product(alpha_grid, gamma_grid, delta_grid)\n",
    "\n",
    "restrictiveness, stderr = compute_restrictiveness(z1, z2, p1, expval, ce_data, param_grid)\n",
    "print('restrictiveness: {}'.format(restrictiveness))\n",
    "print('stderr: {}'.format(stderr))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## DA"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [],
   "source": [
    "# coarse grid for test\n",
    "alpha_grid_size = 0.1\n",
    "eta_grid_size = 0.2\n",
    "alpha_lbd = 0.1\n",
    "alpha_ubd = 1\n",
    "eta_lbd = -1\n",
    "eta_ubd = 5\n",
    "alpha_grid = np.arange(alpha_lbd, alpha_ubd+alpha_grid_size, alpha_grid_size)\n",
    "eta_grid = np.arange(eta_lbd, eta_ubd+eta_grid_size, eta_grid_size)\n",
    "param_grid = cartesian_product(alpha_grid,eta_grid)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "restrictiveness: 0.6239617919891522\n",
      "stderr: 0.006716433665665427\n"
     ]
    }
   ],
   "source": [
    "# coarse grid for test\n",
    "restrictiveness, stderr = compute_restrictiveness(z1, z2, p1, expval, ce_data, param_grid, closest=closest_DA)\n",
    "print('restrictiveness: {}'.format(restrictiveness))\n",
    "print('stderr: {}'.format(stderr))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [],
   "source": [
    "# fine_grid\n",
    "alpha_grid_size = 0.01\n",
    "eta_grid_size = 0.01\n",
    "alpha_ubd = 1\n",
    "eta_lbd = -1\n",
    "eta_ubd = 5\n",
    "alpha_grid = np.arange(alpha_lbd, alpha_ubd+alpha_grid_size, alpha_grid_size)\n",
    "eta_grid = np.arange(eta_lbd, eta_ubd+eta_grid_size, eta_grid_size)\n",
    "param_grid = cartesian_product(alpha_grid,eta_grid)\n",
    "\n",
    "restrictiveness, stderr = compute_restrictiveness(z1, z2, p1, expval, ce_data, param_grid, closest=closest_DA)\n",
    "print('restrictiveness: {}'.format(restrictiveness))\n",
    "print('stderr: {}'.format(stderr))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "restrictiveness: 0.941650500772963\n",
      "stderr: 0.004161237125432136\n"
     ]
    }
   ],
   "source": [
    "# alpha\n",
    "alpha_grid = np.arange(alpha_lbd, alpha_ubd+alpha_grid_size, alpha_grid_size)\n",
    "eta_grid = np.array([0.0])\n",
    "param_grid = cartesian_product(alpha_grid,eta_grid)\n",
    "\n",
    "restrictiveness, stderr = compute_restrictiveness(z1, z2, p1, expval, ce_data, param_grid, closest=closest_DA)\n",
    "print('restrictiveness: {}'.format(restrictiveness))\n",
    "print('stderr: {}'.format(stderr))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "restrictiveness: 0.7010541599998676\n",
      "stderr: 0.008611465428502187\n"
     ]
    }
   ],
   "source": [
    "# eta\n",
    "alpha_grid = np.array([1.0])\n",
    "eta_grid = np.arange(eta_lbd, eta_ubd+eta_grid_size, eta_grid_size)\n",
    "param_grid = cartesian_product(alpha_grid,eta_grid)\n",
    "\n",
    "restrictiveness, stderr = compute_restrictiveness(z1, z2, p1, expval, ce_data, param_grid, closest=closest_DA)\n",
    "print('restrictiveness: {}'.format(restrictiveness))\n",
    "print('stderr: {}'.format(stderr))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": []
  }
 ],
 "metadata": {
  "interpreter": {
   "hash": "467413b114cd9134d7aa238bec836f54570ff1ba3d80473303273a6846277aef"
  },
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
